/*
 Navicat Premium Data Transfer

 Source Server         : localMysql
 Source Server Type    : MySQL
 Source Server Version : 80300
 Source Host           : localhost:3306
 Source Schema         : just_do_it

 Target Server Type    : MySQL
 Target Server Version : 80300
 File Encoding         : 65001

 Date: 27/10/2024 06:44:32
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for statement
-- ----------------------------
DROP TABLE IF EXISTS `statement`;
CREATE TABLE `statement` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `statement_key` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '报表sql key',
  `statement_sql` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '报表sql',
  `statement_remark` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '报表sql描述',
  `create_id` bigint NOT NULL COMMENT '创建人id',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `update_id` bigint DEFAULT NULL COMMENT '修改人id',
  `update_time` datetime DEFAULT NULL COMMENT '修改时间',
  `delete_flag` int NOT NULL DEFAULT '0' COMMENT '逻辑删除标识符  0 未删除   1 已删除',
  `ext_data` json DEFAULT NULL COMMENT '扩展属性',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='数据报表';

-- ----------------------------
-- Records of statement
-- ----------------------------
BEGIN;
INSERT INTO `statement` (`id`, `statement_key`, `statement_sql`, `statement_remark`, `create_id`, `create_time`, `update_id`, `update_time`, `delete_flag`, `ext_data`) VALUES (4, 'login', 'SELECT CASE\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Monday\' THEN \'1\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Tuesday\' THEN \'2\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Wednesday\' THEN \'3\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Thursday\' THEN \'4\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Friday\' THEN \'5\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Saturday\' THEN \'6\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Sunday\' THEN \'7\'\n           END  AS weekDay,\n       COUNT(*) AS dataCount\nFROM system_record\nWHERE record_key = \'login\'\n  and create_time >= now() - INTERVAL 30 MONTH\nGROUP BY weekDay\norder by weekDay', '系统登录(最近30个月 按照周期分组查询数据量)', 1, '2024-07-14 00:12:03', NULL, NULL, 0, NULL);
INSERT INTO `statement` (`id`, `statement_key`, `statement_sql`, `statement_remark`, `create_id`, `create_time`, `update_id`, `update_time`, `delete_flag`, `ext_data`) VALUES (5, 'notice', 'SELECT CASE\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Monday\' THEN \'1\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Tuesday\' THEN \'2\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Wednesday\' THEN \'3\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Thursday\' THEN \'4\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Friday\' THEN \'5\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Saturday\' THEN \'6\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Sunday\' THEN \'7\'\n           END  AS weekDay,\n       COUNT(*) AS dataCount\nFROM system_record\nWHERE record_key = \'notice\'\n  and create_time >= now() - INTERVAL 30 MONTH\nGROUP BY weekDay\norder by weekDay', '信息量(最近30个月 按照周期分组查询数据量)', 1, '2024-07-14 00:15:09', NULL, NULL, 0, NULL);
INSERT INTO `statement` (`id`, `statement_key`, `statement_sql`, `statement_remark`, `create_id`, `create_time`, `update_id`, `update_time`, `delete_flag`, `ext_data`) VALUES (6, 'apply', 'SELECT CASE\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Monday\' THEN \'1\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Tuesday\' THEN \'2\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Wednesday\' THEN \'3\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Thursday\' THEN \'4\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Friday\' THEN \'5\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Saturday\' THEN \'6\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Sunday\' THEN \'7\'\n           END  AS weekDay,\n       COUNT(*) AS dataCount\nFROM system_record\nWHERE record_key = \'apply\'\n  and create_time >= now() - INTERVAL 30 MONTH\nGROUP BY weekDay\norder by weekDay', '数据量(最近30个月 按照周期分组查询数据量)', 1, '2024-07-14 00:15:19', NULL, NULL, 0, NULL);
INSERT INTO `statement` (`id`, `statement_key`, `statement_sql`, `statement_remark`, `create_id`, `create_time`, `update_id`, `update_time`, `delete_flag`, `ext_data`) VALUES (7, 'approve', 'SELECT CASE\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Monday\' THEN \'1\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Tuesday\' THEN \'2\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Wednesday\' THEN \'3\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Thursday\' THEN \'4\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Friday\' THEN \'5\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Saturday\' THEN \'6\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Sunday\' THEN \'7\'\n           END  AS weekDay,\n       COUNT(*) AS dataCount\nFROM system_record\nWHERE record_key = \'approve\'\n  and create_time >= now() - INTERVAL 3 MONTH\nGROUP BY weekDay\norder by weekDay', '业务量(最近七天数据量)', 1, '2024-07-14 00:15:31', NULL, NULL, 0, NULL);
INSERT INTO `statement` (`id`, `statement_key`, `statement_sql`, `statement_remark`, `create_id`, `create_time`, `update_id`, `update_time`, `delete_flag`, `ext_data`) VALUES (8, 'loginTotal', 'select count(id) as dataCount from system_record where record_key = \'login\' ', '系统登录(总数据量)', 1, '2024-07-14 00:43:55', NULL, NULL, 0, NULL);
INSERT INTO `statement` (`id`, `statement_key`, `statement_sql`, `statement_remark`, `create_id`, `create_time`, `update_id`, `update_time`, `delete_flag`, `ext_data`) VALUES (9, 'noticeTotal', 'select count(id) as dataCount from system_record where record_key = \'notice\' ', '信息量(总数据量)', 1, '2024-07-14 00:44:57', NULL, NULL, 0, NULL);
INSERT INTO `statement` (`id`, `statement_key`, `statement_sql`, `statement_remark`, `create_id`, `create_time`, `update_id`, `update_time`, `delete_flag`, `ext_data`) VALUES (10, 'applyTotal', 'select count(id) as dataCount from system_record where record_key = \'apply\' ', '业务量(总数据量)', 1, '2024-07-14 00:45:33', NULL, NULL, 0, NULL);
INSERT INTO `statement` (`id`, `statement_key`, `statement_sql`, `statement_remark`, `create_id`, `create_time`, `update_id`, `update_time`, `delete_flag`, `ext_data`) VALUES (11, 'approveTotal', 'select count(id) as dataCount from system_record where record_key = \'approve\' ', '业务量(总数据量)', 1, '2024-07-14 00:45:55', NULL, NULL, 0, NULL);
INSERT INTO `statement` (`id`, `statement_key`, `statement_sql`, `statement_remark`, `create_id`, `create_time`, `update_id`, `update_time`, `delete_flag`, `ext_data`) VALUES (12, 'approveRadar', 'SELECT CASE\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Monday\' THEN \'1\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Tuesday\' THEN \'2\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Wednesday\' THEN \'3\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Thursday\' THEN \'4\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Friday\' THEN \'5\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Saturday\' THEN \'6\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Sunday\' THEN \'7\'\n           END  AS weekDay,\n       COUNT(*) AS dataCount\nFROM system_record\nWHERE record_key = \'approve\'\n  and create_time >= now() - INTERVAL 3 MONTH\n  and DATE_FORMAT(create_time, \'%W\') != \'Sunday\'\nGROUP BY weekDay\norder by weekDay', '业务量(雷达图报表)', 1, '2024-07-14 16:13:17', NULL, NULL, 0, NULL);
INSERT INTO `statement` (`id`, `statement_key`, `statement_sql`, `statement_remark`, `create_id`, `create_time`, `update_id`, `update_time`, `delete_flag`, `ext_data`) VALUES (13, 'noticeRadar', 'SELECT CASE\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Monday\' THEN \'1\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Tuesday\' THEN \'2\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Wednesday\' THEN \'3\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Thursday\' THEN \'4\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Friday\' THEN \'5\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Saturday\' THEN \'6\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Sunday\' THEN \'7\'\n           END  AS weekDay,\n       COUNT(*) AS dataCount\nFROM system_record\nWHERE record_key = \'notice\'\n  and create_time >= now() - INTERVAL 3 MONTH\n  and DATE_FORMAT(create_time, \'%W\') != \'Sunday\'\nGROUP BY weekDay\norder by weekDay', '信息量(雷达图报表)', 1, '2024-07-14 16:27:25', NULL, NULL, 0, NULL);
INSERT INTO `statement` (`id`, `statement_key`, `statement_sql`, `statement_remark`, `create_id`, `create_time`, `update_id`, `update_time`, `delete_flag`, `ext_data`) VALUES (14, 'applyRadar', 'SELECT CASE\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Monday\' THEN \'1\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Tuesday\' THEN \'2\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Wednesday\' THEN \'3\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Thursday\' THEN \'4\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Friday\' THEN \'5\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Saturday\' THEN \'6\'\n           WHEN DATE_FORMAT(create_time, \'%W\') = \'Sunday\' THEN \'7\'\n           END  AS weekDay,\n       COUNT(*) AS dataCount\nFROM system_record\nWHERE record_key = \'apply\'\n  and create_time >= now() - INTERVAL 3 MONTH\n  and DATE_FORMAT(create_time, \'%W\') != \'Sunday\'\nGROUP BY weekDay\norder by weekDay', '会议申请(雷达图报表)', 1, '2024-07-14 16:31:03', NULL, NULL, 0, NULL);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
